home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
vol_100
/
141_01
/
graph.doc
< prev
next >
Wrap
Text File
|
1985-03-09
|
2KB
|
69 lines
/* graprim.doc - primitives for CHROMAtrs/TMS9918A graphics */
/* after an .asm package marked
"(c) 1982 South Shore Computer Concepts, Hewlett, NY"
rewritten (NOT copied!) in BDS C 1983 Sep pmk */
/* vram addresses are NOT self-adjusting - DON'T MOVE THEM ! */
mode2 () /* set up tms9918 graphics mode 2 */
cls (fore_gr, back_gr) /* clear screen */
short fore_gr, back_gr ;
spr_init () /* clear sprite pattern table */
spr_def (pat_num, pat) /* define sprite pattern */
char pat_num, pat[32];
spr_patc (sp_num, pat_num, col) /* set sprite pattern, color */
char sp_num, pat_num, col;
spr_mov (sp_num, x, y) /* move sprite to x, y */
char sp_num, x, y ;
ld_font (font) /* load font.def, define characters */
short font[0x60][6] ; /* dot-matrix images, 6 bytes/char */
cbar () /* draw colored bars */
wr_str (font, x, y, foregr, text) /* write string */
unsigned x, y, foregr ; char **font, *text ;
wr_ch (font, x, y, foregr, ch) /* write char to screen, G2 */
short font[0x60][6] ; unsigned x, y, foregr, ch ;
follow (sprite, stk, pat, off, col, x, y)
/* track joystick stk with sprite */
set (h, v, col) /* point on */
unsigned h, v, col ;
reset (h, v) /* point off */
unsigned h, v ;
test (h, v) /* test point */
unsigned h, v ;
xycalc (h, v, offset, b_m) /* find byte & bit for (h, v) */
unsigned h, v, *offset, *b_m ;
vram_test () /* write vram, read back */
vram_err (l, r, w)
vram_out (addr, data) /* output to vram thru tms9918a */
unsigned addr, data ;
vram_in (addr) /* input from vram thru tms9918a */
unsigned addr ;
vreg_out (reg, data) /* output to vreg in tms9918a */
unsigned reg, data ;
port_on () /* enable i/o bus (modiii?), read status */
unsigned sprite, stk, pat, off, col, x, y ;
s, 6 bytes/char */
cbar () /* draw colored bars */
wr_str (font, x, y, foregr, text) /* write string *